﻿package com.shangda.util;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.math.MathContext;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.Random;

public class TestUtil {
	public static void main(String[] args) throws Exception {
		
		/*int begin = 0;
		byte [] shows = {35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,
						 35,65,1,2,3,4,5,6,7,8,
						 35,65,1,2,3,4,5,6,7,8,
						 35,65,1,2,3,4,5,6,7,8,
						 1,2,
						 35,65,1,2,3,4,5,6,7,8,
						 35,65,1,2,3,4,5,6,7,8,
						 35,65,1,2,3,4,5,6,7,8,
						 1,2,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4,5,6,7,8,
						 35,35,1,2,3,4};
		byte [] temp = new byte[76];
		for (begin=0; begin < 292;){
			
			if (shows[begin] == '#' && shows[begin+1] == '#'){
				
				for (int i = begin;i<begin+76;i++){
					int j = 0;
					temp [j] = shows[i];
					System.out.print(temp[j]+" ");
					j++;
				}
				System.out.println();
				begin = begin + 76;
				continue;
			}
			
			
			if (shows[begin] == '#' && shows[begin+1] =='A'){
				
				for (int i=begin;i<begin+32;i++){
					int j =0;
					temp[j] = shows[i];
					System.out.print(temp[j]+" ");
					j++;
				}
				System.out.println();
				begin = begin + 32;
				continue;
			}
			
			
		}*/
		
		/*FileInputStream in = new FileInputStream("properties/config.properties");
    	Properties p = new Properties();
    	p.load(in);
    	String s = p.getProperty("url");
    	in.close();
    	System.out.println(s);*/
		/*Date date = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		System.out.println(formatter.format(date));
		for (int i=0;i<10;i++){
			
			date.setTime(date.getTime()-60000);
			System.out.println(formatter.format(date));*/
		//List lists = new ArrayList();
		//lists.add(1);
		byte [] data = new byte[] {0x0A, (byte) 0xD7, 0x23, (byte) 0xBC };
		DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data));
		//System.out.println(dis.readFloat());
		System.out.println(dis.readFloat());
		
		/*byte [] datas = new byte[]{
				0x23,0x23,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x2F,
				0x30,0x2F,0x30,0x2F,0x30,0x30,0x32,0x38,0x00,0x0C,0x09,0x02,
				0x00,0x00,0x4D,0x02,0x00,0x00,0x77,0x02,0x00,0x00,(byte) 0xC7,0x00,
				0x00,0x00,(byte) 0xBA,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,
				0x00,0x00,(byte) 0xcd,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,
				0x4c,0x3e,0x40,(byte) 0xcd,(byte) 0xcc,
				(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,0x4c,0x3e,0x40,0x11,0x22,0x33,0x44,0x55,0x66,0x4e,0x0f,0x0d,0x0a,
				0x23,0x23,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x2F,
				0x30,0x2F,0x30,0x2F,0x30,0x30,0x32,0x38,0x00,0x0C,0x09,0x02,
				0x00,0x00,0x4D,0x02,0x00,0x00,0x77,0x02,0x00,0x00,(byte) 0xC7,0x00,
				0x00,0x00,(byte) 0xBA,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,
				0x00,0x00,(byte) 0xcd,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,0x4c,0x3e,0x40,
				(byte) 0xcd,(byte) 0xcc,
				(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,0x4c,0x3e,0x40,0x11,0x22,0x33,0x44,0x55,0x66,0x4e,0x0f,0x0d,0x0a,
				0x23,0x23,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x2F,
				0x30,0x2F,0x30,0x2F,0x30,0x30,0x32,0x38,0x00,0x0C,0x09,0x02,
				0x00,0x00,0x4D,0x02,0x00,0x00,0x77,0x02,0x00,0x00,(byte) 0xC7,0x00,
				0x00,0x00,(byte) 0xBA,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,
				0x00,0x00,(byte) 0xcd,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,0x4c,0x3e,0x40,
				(byte) 0xcd,(byte) 0xcc,
				(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,0x4c,0x3e,0x40,0x11,0x22,0x33,0x44,0x55,0x66,0x4e,0x0f,0x0d,0x0a
		};
		
	    List results = RequestHandel.dataHandelJD(datas, datas.length, null, null, null);
		
		System.out.println(results);*/
		
		/*Random random = new Random();
		float a = random.nextInt(14)%(5) + 10 + random.nextFloat();
		for (int i=0;i<100;i++){
			System.out.println( random.nextInt(14)%(5) + 10 + random.nextFloat());
		}*/
	
		
		
		
		
	}

		


}
